# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-draw
pkgver=6.0.10
pkgrel=1
pkgdesc="A lightweight drawing tool for Linux Deepin"
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-draw"
license=('GPL3')
depends=('deepin-qt5integration' 'dtkcore' 'dtkgui' 'dtkwidget' 'qt5-base' 'qt5-svg'
         'gcc-libs' 'deepin-picker' 'adobe-source-han-sans-otc-fonts')
makedepends=('cmake' 'qt5-tools')
groups=('deepin-extra')
source=("https://github.com/linuxdeepin/deepin-draw/archive/$pkgver/$pkgname-$pkgver.tar.gz"
        $pkgname-missing-include.patch::https://github.com/linuxdeepin/deepin-draw/pull/83.patch)
sha512sums=('abb3d2f3ae5373560aa535c50163f32c7db4152b0b5432a195381fab958ae35f7ea28d61a38710772fb9d1d73afcff1e6ffe7de9a51a01ffba81580966efc122'
            '1c80d45d3d54902693a29ccf691cdfe1c961872a75b764b2de65455c09647c149e82c9e0aec5bc9444422285ac699da7600ffef71536a4532e40dfc4ab044f6d')

prepare() {
  cd deepin-draw-$pkgver
  patch -p1 -i ../$pkgname-missing-include.patch
  sed -e '/set(CMAKE_CXX_FLAGS/d' -e '/set(CMAKE_C_FLAGS/d' -e '/SET(CMAKE_EXE_LINKER_FLAGS/d' \
      -i src/CMakeLists.txt
}

build() {
  cd deepin-draw-$pkgver

  cmake -DCMAKE_INSTALL_PREFIX=/usr .
  make
}

package() {
  cd deepin-draw-$pkgver
  make DESTDIR="$pkgdir" install
}
